package ysq.xyg.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import ysq.xyg.dao.ReceivingDao;
import ysq.xyg.model.Receiving;
import ysq.xyg.service.ReceivingService;

import javax.annotation.Resource;
import java.util.List;

/**
 * 收货管理
 *
 * @author congcong tao
 * @create 2018/8/9 下午10:37
 */
@Service("receivingService")
public class ReceivingServiceImpl extends BaseServiceImpl<Receiving> implements ReceivingService {

    @Resource
    private ReceivingDao receivingDao;
    @Autowired
    public void setReceivingDao(ReceivingDao receivingDao) {
        this.baseDao = receivingDao;
    }

    @Override
    public PageInfo<Receiving> pageInfo(Receiving receiving, int pageSize, int pageNum) {
        PageHelper.startPage(pageNum, pageSize);
        List<Receiving> list = receivingDao.selectEntity(receiving);
        return new PageInfo<Receiving>(list);
    }

    @Override
    public Receiving selectEntityById(String id) {
        return receivingDao.selectEntityById(id);
    }

    @Override
    public Receiving selectLatelyEntity() {
        return receivingDao.selectLatelyEntity();
    }
}
